package com.github.auties00.cobalt.util;

import com.github.auties00.cobalt.model.jid.Jid;
import com.github.auties00.cobalt.model.jid.JidServer;

import java.util.HashMap;
import java.util.Map;

public final class MetaBots {
    private static final Map<String, Jid> botJIDMap;

    static {
        // What is going on at Meta?
        // To update me check the WAWebSimpleSignalPNToFBIDMigration module in WhatsappWeb
        var data = new HashMap<String, Jid>();
        data.put("867051314767696", Jid.of("13135550002", JidServer.user()));
        data.put("1061492271844689", Jid.of("13135550005", JidServer.user()));
        data.put("245886058483988", Jid.of("13135550009", JidServer.user()));
        data.put("3509905702656130", Jid.of("13135550012", JidServer.user()));
        data.put("1059680132034576", Jid.of("13135550013", JidServer.user()));
        data.put("715681030623646", Jid.of("13135550014", JidServer.user()));
        data.put("1644971366323052", Jid.of("13135550015", JidServer.user()));
        data.put("582497970646566", Jid.of("13135550019", JidServer.user()));
        data.put("645459357769306", Jid.of("13135550022", JidServer.user()));
        data.put("294997126699143", Jid.of("13135550023", JidServer.user()));
        data.put("1522631578502677", Jid.of("13135550027", JidServer.user()));
        data.put("719421926276396", Jid.of("13135550030", JidServer.user()));
        data.put("1788488635002167", Jid.of("13135550031", JidServer.user()));
        data.put("24232338603080193", Jid.of("13135550033", JidServer.user()));
        data.put("689289903143209", Jid.of("13135550035", JidServer.user()));
        data.put("871626054177096", Jid.of("13135550039", JidServer.user()));
        data.put("362351902849370", Jid.of("13135550042", JidServer.user()));
        data.put("1744617646041527", Jid.of("13135550043", JidServer.user()));
        data.put("893887762270570", Jid.of("13135550046", JidServer.user()));
        data.put("1155032702135830", Jid.of("13135550047", JidServer.user()));
        data.put("333931965993883", Jid.of("13135550048", JidServer.user()));
        data.put("853748013058752", Jid.of("13135550049", JidServer.user()));
        data.put("1559068611564819", Jid.of("13135550053", JidServer.user()));
        data.put("890487432705716", Jid.of("13135550054", JidServer.user()));
        data.put("240254602395494", Jid.of("13135550055", JidServer.user()));
        data.put("1578420349663261", Jid.of("13135550062", JidServer.user()));
        data.put("322908887140421", Jid.of("13135550065", JidServer.user()));
        data.put("3713961535514771", Jid.of("13135550067", JidServer.user()));
        data.put("997884654811738", Jid.of("13135550070", JidServer.user()));
        data.put("403157239387035", Jid.of("13135550081", JidServer.user()));
        data.put("535242369074963", Jid.of("13135550082", JidServer.user()));
        data.put("946293427247659", Jid.of("13135550083", JidServer.user()));
        data.put("3664707673802291", Jid.of("13135550084", JidServer.user()));
        data.put("1821827464894892", Jid.of("13135550085", JidServer.user()));
        data.put("1760312477828757", Jid.of("13135550086", JidServer.user()));
        data.put("439480398712216", Jid.of("13135550087", JidServer.user()));
        data.put("1876735582800984", Jid.of("13135550088", JidServer.user()));
        data.put("984025089825661", Jid.of("13135550089", JidServer.user()));
        data.put("1001336351558186", Jid.of("13135550090", JidServer.user()));
        data.put("3739346336347061", Jid.of("13135550091", JidServer.user()));
        data.put("3632749426974980", Jid.of("13135550092", JidServer.user()));
        data.put("427864203481615", Jid.of("13135550093", JidServer.user()));
        data.put("1434734570493055", Jid.of("13135550094", JidServer.user()));
        data.put("992873449225921", Jid.of("13135550095", JidServer.user()));
        data.put("813087747426445", Jid.of("13135550096", JidServer.user()));
        data.put("806369104931434", Jid.of("13135550098", JidServer.user()));
        data.put("1220982902403148", Jid.of("13135550099", JidServer.user()));
        data.put("1365893374104393", Jid.of("13135550100", JidServer.user()));
        data.put("686482033622048", Jid.of("13135550200", JidServer.user()));
        data.put("1454999838411253", Jid.of("13135550201", JidServer.user()));
        data.put("718584497008509", Jid.of("13135550202", JidServer.user()));
        data.put("743520384213443", Jid.of("13135550301", JidServer.user()));
        data.put("1147715789823789", Jid.of("13135550302", JidServer.user()));
        data.put("1173034540372201", Jid.of("13135550303", JidServer.user()));
        data.put("974785541030953", Jid.of("13135550304", JidServer.user()));
        data.put("1122200255531507", Jid.of("13135550305", JidServer.user()));
        data.put("899669714813162", Jid.of("13135550306", JidServer.user()));
        data.put("631880108970650", Jid.of("13135550307", JidServer.user()));
        data.put("435816149330026", Jid.of("13135550308", JidServer.user()));
        data.put("1368717161184556", Jid.of("13135550309", JidServer.user()));
        data.put("7849963461784891", Jid.of("13135550310", JidServer.user()));
        data.put("3609617065968984", Jid.of("13135550312", JidServer.user()));
        data.put("356273980574602", Jid.of("13135550313", JidServer.user()));
        data.put("1043447920539760", Jid.of("13135550314", JidServer.user()));
        data.put("1052764336525346", Jid.of("13135550315", JidServer.user()));
        data.put("2631118843732685", Jid.of("13135550316", JidServer.user()));
        data.put("510505411332176", Jid.of("13135550317", JidServer.user()));
        data.put("1945664239227513", Jid.of("13135550318", JidServer.user()));
        data.put("1518594378764656", Jid.of("13135550319", JidServer.user()));
        data.put("1378821579456138", Jid.of("13135550320", JidServer.user()));
        data.put("490214716896013", Jid.of("13135550321", JidServer.user()));
        data.put("1028577858870699", Jid.of("13135550322", JidServer.user()));
        data.put("308915665545959", Jid.of("13135550323", JidServer.user()));
        data.put("845884253678900", Jid.of("13135550324", JidServer.user()));
        data.put("995031308616442", Jid.of("13135550325", JidServer.user()));
        data.put("2787365464763437", Jid.of("13135550326", JidServer.user()));
        data.put("1532790990671645", Jid.of("13135550327", JidServer.user()));
        data.put("302617036180485", Jid.of("13135550328", JidServer.user()));
        data.put("723376723197227", Jid.of("13135550329", JidServer.user()));
        data.put("8393570407377966", Jid.of("13135550330", JidServer.user()));
        data.put("1931159970680725", Jid.of("13135550331", JidServer.user()));
        data.put("401073885688605", Jid.of("13135550332", JidServer.user()));
        data.put("2234478453565422", Jid.of("13135550334", JidServer.user()));
        data.put("814748673882312", Jid.of("13135550335", JidServer.user()));
        data.put("26133635056281592", Jid.of("13135550336", JidServer.user()));
        data.put("1439804456676119", Jid.of("13135550337", JidServer.user()));
        data.put("889851503172161", Jid.of("13135550338", JidServer.user()));
        data.put("1018283232836879", Jid.of("13135550339", JidServer.user()));
        data.put("1012781386779537", Jid.of("13135559000", JidServer.user()));
        data.put("823280953239532", Jid.of("13135559001", JidServer.user()));
        data.put("1597090934573334", Jid.of("13135559002", JidServer.user()));
        data.put("485965054020343", Jid.of("13135559003", JidServer.user()));
        data.put("1033381648363446", Jid.of("13135559004", JidServer.user()));
        data.put("491802010206446", Jid.of("13135559005", JidServer.user()));
        data.put("1017139033184870", Jid.of("13135559006", JidServer.user()));
        data.put("499638325922174", Jid.of("13135559008", JidServer.user()));
        data.put("468946335863664", Jid.of("13135559009", JidServer.user()));
        data.put("1570389776875816", Jid.of("13135559010", JidServer.user()));
        data.put("1004342694328995", Jid.of("13135559011", JidServer.user()));
        data.put("1012240323971229", Jid.of("13135559012", JidServer.user()));
        data.put("392171787222419", Jid.of("13135559013", JidServer.user()));
        data.put("952081212945019", Jid.of("13135559016", JidServer.user()));
        data.put("444507875070178", Jid.of("13135559017", JidServer.user()));
        data.put("1274819440594668", Jid.of("13135559018", JidServer.user()));
        data.put("1397041101147050", Jid.of("13135559019", JidServer.user()));
        data.put("425657699872640", Jid.of("13135559020", JidServer.user()));
        data.put("532292852562549", Jid.of("13135559021", JidServer.user()));
        data.put("705863241720292", Jid.of("13135559022", JidServer.user()));
        data.put("476449815183959", Jid.of("13135559023", JidServer.user()));
        data.put("488071553854222", Jid.of("13135559024", JidServer.user()));
        data.put("468693832665397", Jid.of("13135559025", JidServer.user()));
        data.put("517422564037340", Jid.of("13135559026", JidServer.user()));
        data.put("819805466613825", Jid.of("13135559027", JidServer.user()));
        data.put("1847708235641382", Jid.of("13135559028", JidServer.user()));
        data.put("716282970644228", Jid.of("13135559029", JidServer.user()));
        data.put("521655380527741", Jid.of("13135559030", JidServer.user()));
        data.put("476193631941905", Jid.of("13135559031", JidServer.user()));
        data.put("485600497445562", Jid.of("13135559032", JidServer.user()));
        data.put("440217235683910", Jid.of("13135559033", JidServer.user()));
        data.put("523342446758478", Jid.of("13135559034", JidServer.user()));
        data.put("514784864360240", Jid.of("13135559035", JidServer.user()));
        data.put("505790121814530", Jid.of("13135559036", JidServer.user()));
        data.put("420008964419580", Jid.of("13135559037", JidServer.user()));
        data.put("492141680204555", Jid.of("13135559038", JidServer.user()));
        data.put("388462787271952", Jid.of("13135559039", JidServer.user()));
        data.put("423473920752072", Jid.of("13135559040", JidServer.user()));
        data.put("489574180468229", Jid.of("13135559041", JidServer.user()));
        data.put("432360635854105", Jid.of("13135559042", JidServer.user()));
        data.put("477878201669248", Jid.of("13135559043", JidServer.user()));
        data.put("351656951234045", Jid.of("13135559044", JidServer.user()));
        data.put("430178036732582", Jid.of("13135559045", JidServer.user()));
        data.put("434537312944552", Jid.of("13135559046", JidServer.user()));
        data.put("1240614300631808", Jid.of("13135559047", JidServer.user()));
        data.put("473135945605128", Jid.of("13135559048", JidServer.user()));
        data.put("423669800729310", Jid.of("13135559049", JidServer.user()));
        data.put("3685666705015792", Jid.of("13135559050", JidServer.user()));
        data.put("504196509016638", Jid.of("13135559051", JidServer.user()));
        data.put("346844785189449", Jid.of("13135559052", JidServer.user()));
        data.put("504823088911074", Jid.of("13135559053", JidServer.user()));
        data.put("402669415797083", Jid.of("13135559054", JidServer.user()));
        data.put("490939640234431", Jid.of("13135559055", JidServer.user()));
        data.put("875124128063715", Jid.of("13135559056", JidServer.user()));
        data.put("468788962654605", Jid.of("13135559057", JidServer.user()));
        data.put("562386196354570", Jid.of("13135559058", JidServer.user()));
        data.put("372159285928791", Jid.of("13135559059", JidServer.user()));
        data.put("531017479591050", Jid.of("13135559060", JidServer.user()));
        data.put("1328873881401826", Jid.of("13135559061", JidServer.user()));
        data.put("1608363646390484", Jid.of("13135559062", JidServer.user()));
        data.put("1229628561554232", Jid.of("13135559063", JidServer.user()));
        data.put("348802211530364", Jid.of("13135559064", JidServer.user()));
        data.put("3708535859420184", Jid.of("13135559065", JidServer.user()));
        data.put("415517767742187", Jid.of("13135559066", JidServer.user()));
        data.put("479330341612638", Jid.of("13135559067", JidServer.user()));
        data.put("480785414723083", Jid.of("13135559068", JidServer.user()));
        data.put("387299107507991", Jid.of("13135559069", JidServer.user()));
        data.put("333389813188944", Jid.of("13135559070", JidServer.user()));
        data.put("391794130316996", Jid.of("13135559071", JidServer.user()));
        data.put("457893470576314", Jid.of("13135559072", JidServer.user()));
        data.put("435550496166469", Jid.of("13135559073", JidServer.user()));
        data.put("1620162702100689", Jid.of("13135559074", JidServer.user()));
        data.put("867491058616043", Jid.of("13135559075", JidServer.user()));
        data.put("816224117357759", Jid.of("13135559076", JidServer.user()));
        data.put("334065176362830", Jid.of("13135559077", JidServer.user()));
        data.put("489973170554709", Jid.of("13135559078", JidServer.user()));
        data.put("473060669049665", Jid.of("13135559079", JidServer.user()));
        data.put("1221505815643060", Jid.of("13135559080", JidServer.user()));
        data.put("889000703096359", Jid.of("13135559081", JidServer.user()));
        data.put("475235961979883", Jid.of("13135559082", JidServer.user()));
        data.put("3434445653519934", Jid.of("13135559084", JidServer.user()));
        data.put("524503026827421", Jid.of("13135559085", JidServer.user()));
        data.put("1179639046403856", Jid.of("13135559086", JidServer.user()));
        data.put("471563305859144", Jid.of("13135559087", JidServer.user()));
        data.put("533896609192881", Jid.of("13135559088", JidServer.user()));
        data.put("365443583168041", Jid.of("13135559089", JidServer.user()));
        data.put("836082305329393", Jid.of("13135559090", JidServer.user()));
        data.put("1056787705969916", Jid.of("13135559091", JidServer.user()));
        data.put("503312598958357", Jid.of("13135559092", JidServer.user()));
        data.put("3718606738453460", Jid.of("13135559093", JidServer.user()));
        data.put("826066052850902", Jid.of("13135559094", JidServer.user()));
        data.put("1033611345091888", Jid.of("13135559095", JidServer.user()));
        data.put("3868390816783240", Jid.of("13135559096", JidServer.user()));
        data.put("7462677740498860", Jid.of("13135559097", JidServer.user()));
        data.put("436288576108573", Jid.of("13135559098", JidServer.user()));
        data.put("1047559746718900", Jid.of("13135559099", JidServer.user()));
        data.put("1099299455255491", Jid.of("13135559100", JidServer.user()));
        data.put("1202037301040633", Jid.of("13135559101", JidServer.user()));
        data.put("1720619402074074", Jid.of("13135559102", JidServer.user()));
        data.put("1030422235101467", Jid.of("13135559103", JidServer.user()));
        data.put("827238979523502", Jid.of("13135559104", JidServer.user()));
        data.put("1516443722284921", Jid.of("13135559105", JidServer.user()));
        data.put("1174442747196709", Jid.of("13135559106", JidServer.user()));
        data.put("1653165225503842", Jid.of("13135559107", JidServer.user()));
        data.put("1037648777635013", Jid.of("13135559108", JidServer.user()));
        data.put("551617757299900", Jid.of("13135559109", JidServer.user()));
        data.put("1158813558718726", Jid.of("13135559110", JidServer.user()));
        data.put("2463236450542262", Jid.of("13135559111", JidServer.user()));
        data.put("1550393252501466", Jid.of("13135559112", JidServer.user()));
        data.put("2057065188042796", Jid.of("13135559113", JidServer.user()));
        data.put("506163028760735", Jid.of("13135559114", JidServer.user()));
        data.put("2065249100538481", Jid.of("13135559115", JidServer.user()));
        data.put("1041382867195858", Jid.of("13135559116", JidServer.user()));
        data.put("886500209499603", Jid.of("13135559117", JidServer.user()));
        data.put("1491615624892655", Jid.of("13135559118", JidServer.user()));
        data.put("486563697299617", Jid.of("13135559119", JidServer.user()));
        data.put("1175736513679463", Jid.of("13135559120", JidServer.user()));
        data.put("491811473512352", Jid.of("13165550064", JidServer.user()));
        botJIDMap = data;
    }

    private MetaBots() {
        throw new UnsupportedOperationException("This is a utility class and cannot be instantiated");
    }

    public static Jid translate(Jid jid) {
        if(!jid.hasServer(JidServer.bot())) {
            throw new IllegalArgumentException("Expected a bot value");
        }

        var translated = botJIDMap.get(jid.user());
        if(translated == null) {
            throw new IllegalArgumentException("Unknown bot: " + jid);
        }

        return translated;
    }
}
